from django.db import models


class Message(models.Model):
    entity_id = models.IntegerField(verbose_name='保存device_id或者appointment_id', null=True)
    message_type = models.IntegerField(verbose_name='消息类型 0-预约消息； 1-信用分消息； 2- 设备维修；3-设备上新')
    content = models.CharField(max_length=255, blank=True, null=True, verbose_name='拒绝原因')
    create_time = models.DateTimeField(blank=True, null=True, verbose_name='消息创建时间')

    class Meta:
        managed = False
        db_table = 'message'
        verbose_name = '消息表'


class UserMessageView(models.Model):
    user_id = models.IntegerField(verbose_name='用户id')
    message_id = models.IntegerField(verbose_name='消息id')
    is_read = models.IntegerField(verbose_name='是否阅读')

    class Meta:
        managed = False
        db_table = 'user_message_view'
        verbose_name = '用户消息已读情况表'
